home *** CD-ROM | disk | FTP | other *** search
- <script language="VBScript">
-
- Sub OnContextMenu()
- On Error Resume Next
- set l = external.menuArguments.document.parentWindow.top.document.location
- a = "" & l.href
- if Err then
- Err.Clear
- set l = external.menuArguments.document.location
- end if
- a = "" & l.href
- if InStr(a, "http://") <> 1 then
- alert "Sorry, WebWarper is not applicable for this page. " & Chr(13) _
- & "It is viewed through the """ & l.protocol _
- & """ protocol," & Chr(13) & "but WebWarper can be used only with " _
- & "pages viewed" & Chr(13) & "through the ""http://"" protocol."
- exit sub
- end if
- if InStr(1, a, "http://siams.com", 1) <> 1 then exit sub
- a = Right(a, Len(a)-Len("http://siams.com"))
-
- i1 = InStr(a,"/ww.pl/")
- i2 = InStr(a,"/ww.pl?")
- if (i1 < 1) and (i2 < 1) then exit sub
- if i1 >= 1 then
- if i1 > 1 then
- port = Left(a,i1-1)
- if Left(port,1) <> ":" then exit sub
- port = Right(port,Len(port)-1)
- if CStr(CInt(port)) <> port then exit sub
- end if
- a = Right(a, Len(a)-Len("/ww.pl/")-i1+1)
- elseif i2 >= 1 then
- if i2 > 1 then
- port = Left(a,i2-1)
- if Left(port,1) <> ":" then exit sub
- port = Right(port,Len(port)-1)
- if CStr(CInt(port)) <> port then exit sub
- end if
- a = Right(a, Len(a)-Len("/ww.pl?")-i2+1)
- if LCase(Left(a,5))="info=" then exit sub
- if LCase(Left(a,5))="lang=" then exit sub
- end if
-
- if InStr(a, "~") = 1 then a = Right(a, Len(a)-InStr(a, "/"))
- if InStr(a, "/") = 1 then a = "siams.com" & a
- a = "http://" & a
- h = ""
- p = InStr(a, "#")
- if p > 0 then
- h = Right(a, Len(a)-p+1)
- a = Left(a, p-1)
- end if
- p = InStr(a, "?*")
- if p = Len(a)-1 then
- l.href = Left(a, p-1) & h
- exit sub
- end if
- p = InStr(a, "&*")
- if p = Len(a)-1 then
- l.href = Left(a, p-1) & h
- exit sub
- end if
- l.href = a & h
- end sub
-
- OnContextMenu()
-
- </script>
-